/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package backingbeans;

import entities.Notification;
import java.io.Serializable;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.inject.Inject;
import sessions.NotificationManager;

/**
 *
 * @author Antoine Boulinguez et Shyn-Yuan Cheng
 */
@ManagedBean(name="myMessages")
@ViewScoped
public class MyMessages implements Serializable {
    @EJB
    private NotificationManager notificationManager;
    @Inject
    private UserSession userSession;
    
    public List<Notification> getMessages() {
        return notificationManager.getNotifications(userSession.getUser());
    }
}
